class Node:
    def __init__(self,val=None,children=None):
        self.val=val
        self.children=children

def maxDepth(root):
    #创建一个队列
    queueList=[]
    level=0
    if root==None:
        return level
    else:
        queueList.append(root)
        level+=1
    #当我们的队列不空时
    while len(queueList)>0:
        queueListLenght=len(queueList)
        level+=1
        for i in range(queueListLenght):
            #删除队列中第一个元素，并返回给我们的变量
            queueTop=queueList[0]
            queueList.pop(0)
            if queueTop.children!=None:
                for j in queueTop.children:
                    queueList.append(j)
    return level-1

